import 'package:flutter/material.dart';
import 'dart:async';

class MyLoading extends Dialog {
  final String title;

  MyLoading({
    this.title = '加载中',
  });

  void close(context) {
    Navigator.of(context).pop();
  }

  @override
  Widget build(BuildContext context) {
//    _showTimer(context);
    return Material(
      type: MaterialType.transparency,
      child: Center(
        child: Container(
          width: 100,
          height: 100,
          alignment: Alignment.center,
          decoration: BoxDecoration(
              color: Colors.white,
            borderRadius: BorderRadius.circular(10)
          ),
          child: Text('${this.title}'),
        ),
      ),
    );
  }
}
